package com.y.architecture.polliing;

/**
 * Created by youjingjing on 2017/12/12.
 */

public class IntervalPolling
//        extends PollingRequest
{


    private int inteval;

//    public IntervalPolling(int interval, String tag, EventInterface eventInterface, PollingAction action) {
//        super(tag, eventInterface, action);
//        this.inteval = interval;
//    }

//    @Override
//    public Disposable execute(PollingManager manager) {
//        return Observable.interval(inteval, TimeUnit.SECONDS).
//                compose(manager.composeEvent(tag, eventInterface)).
//                observeOn(AndroidSchedulers.mainThread()).
//                doOnNext(new Consumer<Long>() {
//                    @Override
//                    public void accept(Long aLong) throws Exception {
//                        Timber.tag(SyncStateContract.Constants.TAG).d("emit interval polling, Tag = " + tag + ", num = " + aLong);
//                    }
//                }).
//                subscribe(new Consumer<Long>() {
//                    @Override
//                    public void accept(Long num) throws Exception {
//                        if (null != pollingAction) {
//                            pollingAction.doAction(num);
//                        }
//                        Timber.tag(SyncStateContract.Constants.TAG).d("running interval polling, Tag = " + tag + ", num = " + num);
//                    }
//                });
//    }
}
